scoreboard objectives add rmr.local.cycle_tick dummy
execute store result score @s rmr.local.cycle_tick run scoreboard players get @s rmr.entity.timer

scoreboard objectives add rmr.local.tick_every_frame dummy
scoreboard objectives add rmr.local.frame_count dummy
scoreboard players set @s rmr.local.tick_every_frame 2
scoreboard players set @s rmr.local.frame_count 4
scoreboard players operation @s rmr.entity.cycle_tick /= @s rmr.local.tick_every_frame
scoreboard players operation @s rmr.local.cycle_tick %= @s rmr.local.frame_count
scoreboard objectives remove rmr.local.tick_every_frame
scoreboard objectives remove rmr.local.frame_count

execute if score @s rmr.local.cycle_tick matches 0 run data modify entity @s transformation.left_rotation set from storage minecraft:rmr flying_axe_spin_data[0]
execute if score @s rmr.local.cycle_tick matches 1 run data modify entity @s transformation.left_rotation set from storage minecraft:rmr flying_axe_spin_data[1]
execute if score @s rmr.local.cycle_tick matches 2 run data modify entity @s transformation.left_rotation set from storage minecraft:rmr flying_axe_spin_data[2]
execute if score @s rmr.local.cycle_tick matches 3 run data modify entity @s transformation.left_rotation set from storage minecraft:rmr flying_axe_spin_data[3]

scoreboard objectives remove rmr.local.cycle_tick

